<!DOCTYPE html>
<html lang="en">
<head>
<title>Brook Tardigrade: BrookURLRouter: Class TBrookURLRouter</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="tipuesearch/tipuesearch.css">

<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<div class="container"><div class="navigation">
<h2><a href="index.html">Brook Tardigrade</a></h2><ul><li><a href="AllUnits.html">Units</a></li><li><a href="ClassHierarchy.html">Class Hierarchy</a></li><li><a href="AllClasses.html">Classes, Interfaces, Objects and Records</a></li><li><a href="AllTypes.html">Types</a></li><li><a href="AllVariables.html">Variables</a></li><li><a href="AllConstants.html">Constants</a></li><li><a href="AllFunctions.html">Functions and Procedures</a></li><li><a href="AllIdentifiers.html">Identifiers</a></li><li><form class="search-form" action="tipue_results.html"><div class="search-input"><input type="text" name="q" id="tipue_search_input" pattern=".{3,}" title="At least 3 characters" required><div class="search-button"><input type="button" id="tipue_search_button" onclick="this.form.submit();"></div></div></form>
<div style="clear: both"></div>
</li></ul></div><div class="content">
<span id="TBrookURLRouter"></span><h1 class="cio">Class TBrookURLRouter</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section">Fields</div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section"><a class="section" href="#PasDoc-Properties">Properties</a></div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="BrookURLRouter.html">BrookURLRouter</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TBrookURLRouter = class(<a class="normal" href="BrookHandledClasses.TBrookHandledComponent.html">TBrookHandledComponent</a>)</code></p>
<h2 class="description">Description</h2>
<p>
URL router component.</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="ancestor">TPersistent</li>
<li class="ancestor">TComponent</li>
<li class="ancestor"><a class="normal" href="BrookHandledClasses.TBrookHandledComponent.html">TBrookHandledComponent</a></li>
<li class="thisitem">TBrookURLRouter</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <strong><a href="BrookURLRouter.TBrookURLRouter.html#Create">Create</a></strong>(AOwner: TComponent); override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>destructor <strong><a href="BrookURLRouter.TBrookURLRouter.html#Destroy">Destroy</a></strong>; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="BrookURLRouter.TBrookURLRouter.html#GetEnumerator">GetEnumerator</a></strong>: <a href="BrookURLRouter.TBrookURLRoutesEnumerator.html">TBrookURLRoutesEnumerator</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="BrookURLRouter.TBrookURLRouter.html#Add">Add</a></strong>: <a href="BrookURLRouter.TBrookURLRoute.html">TBrookURLRoute</a>; inline;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <strong><a href="BrookURLRouter.TBrookURLRouter.html#Remove">Remove</a></strong>(const APattern: string); inline;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <strong><a href="BrookURLRouter.TBrookURLRouter.html#Clear">Clear</a></strong>; inline;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <strong><a href="BrookURLRouter.TBrookURLRouter.html#Open">Open</a></strong>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <strong><a href="BrookURLRouter.TBrookURLRouter.html#Close">Close</a></strong>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="BrookURLRouter.TBrookURLRouter.html#DispatchRoute">DispatchRoute</a></strong>(const APath: string; AUserData: Pointer): Boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <strong><a href="BrookURLRouter.TBrookURLRouter.html#Route">Route</a></strong>(ASender: TObject; const APath: string; ARequest: <a href="BrookHTTPRequest.TBrookHTTPRequest.html">TBrookHTTPRequest</a>; AResponse: <a href="BrookHTTPResponse.TBrookHTTPResponse.html">TBrookHTTPResponse</a>); overload; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <strong><a href="BrookURLRouter.TBrookURLRouter.html#Route">Route</a></strong>(ASender: TObject; ARequest: <a href="BrookHTTPRequest.TBrookHTTPRequest.html">TBrookHTTPRequest</a>; AResponse: <a href="BrookHTTPResponse.TBrookHTTPResponse.html">TBrookHTTPResponse</a>); overload; virtual;</code></td>
</tr>
</table>
<span id="PasDoc-Properties"></span><h3 class="summary">Properties</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <strong><a href="BrookURLRouter.TBrookURLRouter.html#Items">Items</a></strong>[AIndex:Integer]: <a href="BrookURLRouter.TBrookURLRoute.html">TBrookURLRoute</a> read GetItem
      write SetItem;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <strong><a href="BrookURLRouter.TBrookURLRouter.html#Active">Active</a></strong>: Boolean read FActive write SetActive stored IsActiveStored;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <strong><a href="BrookURLRouter.TBrookURLRouter.html#Routes">Routes</a></strong>: <a href="BrookURLRouter.TBrookURLRoutes.html">TBrookURLRoutes</a> read FRoutes write SetRoutes;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <strong><a href="BrookURLRouter.TBrookURLRouter.html#OnRoute">OnRoute</a></strong>: <a href="BrookURLRouter.html#TBrookURLRouterRouteEvent">TBrookURLRouterRouteEvent</a> read FOnRoute write FOnRoute;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <strong><a href="BrookURLRouter.TBrookURLRouter.html#OnNotFound">OnNotFound</a></strong>: <a href="BrookURLRouter.html#TBrookURLRouterRouteEvent">TBrookURLRouterRouteEvent</a> read FOnNotFound
      write FOnNotFound;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <strong><a href="BrookURLRouter.TBrookURLRouter.html#OnActivate">OnActivate</a></strong>: TNotifyEvent read FOnActivate write FOnActivate;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <strong><a href="BrookURLRouter.TBrookURLRouter.html#OnDeactivate">OnDeactivate</a></strong>: TNotifyEvent read FOnDeactivate write FOnDeactivate;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Create"></span><code>constructor <strong>Create</strong>(AOwner: TComponent); override;</code></td>
</tr>
<tr><td colspan="2">
<p>
Creates an instance of <code><a class="normal" href="BrookURLRouter.TBrookURLRouter.html">TBrookURLRouter</a></code>. </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>AOwner[in]</dt>
<dd>Owner component.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Destroy"></span><code>destructor <strong>Destroy</strong>; override;</code></td>
</tr>
<tr><td colspan="2">
<p>
Destroys an instance of <code><a class="normal" href="BrookURLRouter.TBrookURLRouter.html">TBrookURLRouter</a></code>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="GetEnumerator"></span><code>function <strong>GetEnumerator</strong>: <a href="BrookURLRouter.TBrookURLRoutesEnumerator.html">TBrookURLRoutesEnumerator</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Creates an enumerator to iterate the <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Routes">routes</a> through <code>for..in</code>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Add"></span><code>function <strong>Add</strong>: <a href="BrookURLRouter.TBrookURLRoute.html">TBrookURLRoute</a>; inline;</code></td>
</tr>
<tr><td colspan="2">
<p>
Adds a new item to the <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Routes">routes</a> list. </p>
<h6 class="description_section">Returns</h6>
<p class="return"><a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">Route</a> item.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Remove"></span><code>procedure <strong>Remove</strong>(const APattern: string); inline;</code></td>
</tr>
<tr><td colspan="2">
<p>
Removes an item from the <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Routes">routes</a> list by its pattern. </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>APattern[in]</dt>
<dd><a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">Route</a> name.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Clear"></span><code>procedure <strong>Clear</strong>; inline;</code></td>
</tr>
<tr><td colspan="2">
<p>
Clears the <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Routes">routes</a> list.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Open"></span><code>procedure <strong>Open</strong>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Enabled the router component.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Close"></span><code>procedure <strong>Close</strong>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Disables the router component.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="DispatchRoute"></span><code>function <strong>DispatchRoute</strong>(const APath: string; AUserData: Pointer): Boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Finds a <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">route</a> and dispatches it to the client.  </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>APath[in]</dt>
<dd><a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">Route</a> path.</dd>
<dt>AUserData[in]</dt>
<dd>User-defined data.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Route"></span><code>procedure <strong>Route</strong>(ASender: TObject; const APath: string; ARequest: <a href="BrookHTTPRequest.TBrookHTTPRequest.html">TBrookHTTPRequest</a>; AResponse: <a href="BrookHTTPResponse.TBrookHTTPResponse.html">TBrookHTTPResponse</a>); overload; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
<a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Routes">Routes</a> a request passing a given path.    </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>ASender[in]</dt>
<dd>Sender object.</dd>
<dt>APath[in]</dt>
<dd><a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">Route</a> path.</dd>
<dt>ARequest[in]</dt>
<dd>Request object.</dd>
<dt>AResponse[in]</dt>
<dd>Response object.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Route"></span><code>procedure <strong>Route</strong>(ASender: TObject; ARequest: <a href="BrookHTTPRequest.TBrookHTTPRequest.html">TBrookHTTPRequest</a>; AResponse: <a href="BrookHTTPResponse.TBrookHTTPResponse.html">TBrookHTTPResponse</a>); overload; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
<a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Routes">Routes</a> a request obtaining path from the request object.   </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>ASender[in]</dt>
<dd>Sender object.</dd>
<dt>ARequest[in]</dt>
<dd>Request object.</dd>
<dt>AResponse[in]</dt>
<dd>Response object.</dd>
</dl>
</td></tr>
</table>
<h3 class="detail">Properties</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Items"></span><code>property <strong>Items</strong>[AIndex:Integer]: <a href="BrookURLRouter.TBrookURLRoute.html">TBrookURLRoute</a> read GetItem
      write SetItem;</code></td>
</tr>
<tr><td colspan="2">
<p>
Gets/sets a <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">route</a> from/to the <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Routes">routes</a> list by its index.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><span id="Active"></span><code>property <strong>Active</strong>: Boolean read FActive write SetActive stored IsActiveStored;</code></td>
</tr>
<tr><td colspan="2">
<p>
Enabled/disables the router component.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><span id="Routes"></span><code>property <strong>Routes</strong>: <a href="BrookURLRouter.TBrookURLRoutes.html">TBrookURLRoutes</a> read FRoutes write SetRoutes;</code></td>
</tr>
<tr><td colspan="2">
<p>
Available <code>routes</code> list.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><span id="OnRoute"></span><code>property <strong>OnRoute</strong>: <a href="BrookURLRouter.html#TBrookURLRouterRouteEvent">TBrookURLRouterRouteEvent</a> read FOnRoute write FOnRoute;</code></td>
</tr>
<tr><td colspan="2">
<p>
Event triggered when the router dispatches a <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">route</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><span id="OnNotFound"></span><code>property <strong>OnNotFound</strong>: <a href="BrookURLRouter.html#TBrookURLRouterRouteEvent">TBrookURLRouterRouteEvent</a> read FOnNotFound
      write FOnNotFound;</code></td>
</tr>
<tr><td colspan="2">
<p>
Event triggered when a <a class="normal" href="BrookURLRouter.TBrookURLRouter.html#Route">route</a> is not found.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><span id="OnActivate"></span><code>property <strong>OnActivate</strong>: TNotifyEvent read FOnActivate write FOnActivate;</code></td>
</tr>
<tr><td colspan="2">
<p>
Event triggered when the router component is enabled.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><span id="OnDeactivate"></span><code>property <strong>OnDeactivate</strong>: TNotifyEvent read FOnDeactivate write FOnDeactivate;</code></td>
</tr>
<tr><td colspan="2">
<p>
Event triggered when the router component is disabled.</p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0</a>. </em>
</span>
</div></div></body></html>
